package cn.edu.hunau.oop.day03;

import org.junit.Test;

/**
 * @author hb
 * @date 2025-08-06 15:00:07
 */
public class TestStatic {
    @Test
    public void test01(){
        Poo c1 = new Poo();
        System.out.println("=====");
        Coo c2=new Coo();
    }

    @Test
    public void test02(){
        Soo s1=new Soo();
        Soo s2=new Soo();
        Soo s3=new Soo();
        System.out.println(s3.a);
        System.out.println(Soo.s);

    }
}

class Soo{
    int a=1;
    static int s=1;

    public static void main(String [] args){

    }

    public static void staticMethod(){
        System.out.println(s);
    }

    public Soo(){
        a++;
        s++;
    }

}

class Poo{
    static{
        System.out.println("Poo的静态代码块");
    }
    public Poo(){
        System.out.println("Poo的构造方法");
    }
}
class Coo extends Poo{
    static{
        System.out.println("Coo的静态代码块");
    }
    public Coo(){
        System.out.println("Coo的构造方法");
    }
}